package com.example.demo.controller;

import com.example.demo.dao.EmployeeDao;
import com.example.demo.pojo.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Collection;

@Controller
public class sartListCotroller {
    @Autowired
    EmployeeDao employeeDao;
    @RequestMapping("/login/list")
    public String getlist(Model model){
        Collection<Employee> employees = employeeDao.getEmployee();
        model.addAttribute("employees",employees);
        return "homePage";
    }
}
